package com.nondo.rdp.finance.service.impl.setting.home;

import com.nondo.rdp.finance.domain.setting.home.SettingModuleIcon;
import com.nondo.rdp.finance.repository.setting.home.SettingModuleIconRepository;
import com.nondo.rdp.finance.service.setting.home.SettingModuleIconService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Transactional
@Service
public class SettingModuleIconServiceImpl implements SettingModuleIconService {
    @Autowired
    SettingModuleIconRepository settingModuleIconRepository;

    @Override
    public SettingModuleIcon findOne(Long id) {
        return this.settingModuleIconRepository.findOne(id);
    }

    @Override
    public SettingModuleIcon save(SettingModuleIcon settingModuleIcon) {
        return this.settingModuleIconRepository.save(settingModuleIcon);
    }

    @Override
    public void update(SettingModuleIcon settingModuleIcon) {
        this.settingModuleIconRepository.save(settingModuleIcon);
    }

    @Override
    public void delete(Long id) {
        this.settingModuleIconRepository.deleteById(id);
    }

    @Override
    public List<SettingModuleIcon> findAll(Sort sort) {
        return this.settingModuleIconRepository.findAllByDelFlag("0", sort);
    }
}